<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="inputId" value="Hello JS"/><br>
    <input type="button" value="点我" onclick="clickMe()">

    <script>
        function clickMe() {
            console.log('clickMe');
            // var array = document.getElementsByTagName('input');
            // console.log(array);
            // console.log(array[0]);
            // console.log(array[0].value);


            var intputObj = document.getElementById('inputId');
            console.log(intputObj.value);
        }
    </script>
</body>
</html>